package jvm.error;

import java.util.concurrent.TimeUnit;

/**
 * @author jiangwz
 * @create 2019/9/17.
 */
public class UnableCreateNativeThreadDemo {

    /**
     * linux默认不能超过1024个线程(非root用户1024,root无上限),可以修改.
     * @param args
     */
    public static void main(String[] args){

        int i = 0;
        while (true) {
            System.out.println(++i);
            new Thread(() -> {
                try { TimeUnit.SECONDS.sleep(Integer.MAX_VALUE); } catch (InterruptedException e) { e.printStackTrace(); }
                
            }).start();
        }
    }
}
